//
//  PersonalmeetingViewController.m
//  Gxj
//
//  Created by 💋索少杰 on 2017/9/14.
//  Copyright © 2017年 wkq. All rights reserved.
//

#import "PersonalmeetingViewController.h"
#import "MeetingTableViewCell.h"

#import "MineFromViewController.h"

@interface PersonalmeetingViewController ()<UITableViewDelegate,UITableViewDataSource>

@property(nonatomic, strong) UITableView * tableView;


@end

@implementation PersonalmeetingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    

    
    [self setTableView];
}
- (void)setTableView{
    
    _tableView=[[UITableView alloc] initWithFrame:CGRectMake(0, kHeightScale(36), UIScreenWidth, UIScreenHeight) style:UITableViewStylePlain];
    _tableView.delegate=self;
    _tableView.dataSource=self;
    _tableView.scrollEnabled =NO; //设置tableview 不能滚动
    [self.view addSubview:_tableView];
}
//返回每个分区下的单元格个数，必须实现
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return kHeightScale(275);
}
/*设置标题尾的宽度*/
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return kHeightScale(50);
}
//设置标题脚的名称
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    if (section == 0)
    {
        
        UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
        [button setTitle:@"查看更多" forState:UIControlStateNormal ];
        button.titleLabel.font = [UIFont systemFontOfSize:kWidthScale(15)];
        [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        //        button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
        //但是问题又出来，此时文字会紧贴到做边框，我们可以设置
        button.contentEdgeInsets = UIEdgeInsetsMake(0,0, 0, 0);
        //        button.titleEdgeInsets = UIEdgeInsetsMake(0, tableView.origin.x/2-kHeightScale(30), 0, tableView.origin.x/2-40);
        
        return button;
    }
    return nil;
}

- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString * str= @"biao";
    MeetingTableViewCell*cell=[tableView dequeueReusableCellWithIdentifier:str];
    if (!cell) {
        cell=[[MeetingTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:str];
    }
    cell.selectionStyle=UITableViewStylePlain;
    return cell;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
